package io.bluefw.blueui.dsl;

import java.util.List;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class Part {
	private Layout layout;
	private List<Widget> widgets;
	
	public void setEntity(Entity entity) {
		for (Widget widget : widgets) {
			widget.setEntity(entity);
		}
	}
	
	public StringBuffer render() {
		return layout.render(widgets);
	}
}
